package thread;

import java.util.Arrays;

public class work_demo10 {
    public static void main(String[] args) {
        int[] arr1 ={1,3,5,8,0,0,0,0};
        int[] arr2 ={3,6,9,10};
        merge(arr1,4,arr2,4);

    }
    public static void merge(int[] nums1, int m, int[] nums2, int n) {
        int i = 0;
        for(i=0;i<n;i++){
            nums1[i+m] = nums2[i];
        }
        Arrays.sort(nums1);
        System.out.println(Arrays.toString(nums1));
    }
}
